Fix the "hda lost interrupt" issue when creating a VMX guest on a PAE
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Fri, 21 Apr 2006 09:11:00 +0000 (10:11 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Fri, 21 Apr 2006 09:11:00 +0000 (10:11 +0100)
commit7d67a7ab23ff55d302bc10af2f9ee758668f7f2a
tree88e5758cd07b98a903d9377e8508d992252796f1
parentc10f3d80c9ff5559d0b6e2fb1e57a01a9508f124
Fix the "hda lost interrupt" issue when creating a VMX guest on a PAE
host.

Occasionally when injecting an IDE DMA interrupt into the guest, a
page fault occurs (e.g., because the IDT mapping is not present in
shadow pagetables).  This causes an immediate vmexit and, because it
occurred during event delivery, the original VM_ENTRY_INTR_INFO_FIELD
is kept in IDT_VECTORING_INFO_FIELD.

The current code copies IDT_VECTORING_INFO_FIELD back to
VM_ENTRY_INTR_INFO_FIELD, intending that the interrupt will be
injected again on next vmresume.

However, there is a corner case: if, before the next vmresume, a timer
interrupt happened then vmx_intr_assist may overwrite the information
on VM_ENTRY_INTR_INFO_FIELD, and the IDE DMA interrupt is effectively
lost.

This patch checks the IDT_VECTORING_INFO_FIELD in vmx_intr_assist and,
if it is set, copies it to VM_ENTRY_INTR_INFO_FIELD and returns.

Signed-off-by: Yunhong Jiang <Yunhong.jiang@intel.com>
Signed-off-by: Eddie Dong <eddie.dong@intel.com>
xen/arch/x86/hvm/vmx/io.c
xen/arch/x86/hvm/vmx/vmx.c